# -*- coding:utf-8 -*-
# 多继承


class A :
    def __init__(self, a):
        self.a = a
        print('A class init')

    def func(self):
        print(self.a, self.c) # 这种写法耦合性太高

    def func2(self):
        print('A class func2')

class B:
    def __init__(self):
        print('B class init')

    def func2(self):
        print('B class func2')

class AB(A,B):
    def __init__(self, ab, c):
        self.c = c
        super(__class__, self).__init__(ab)

    def func2(self):
        super(__class__, self).func2()
        print('AB class func2')

ab = AB('1', '2')
ab.func()
ab.func2()